package com.yutel.template.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.yutel.system.struts.core.Page;
import com.yutel.template.dao.ITemplateDao;
import com.yutel.template.repository.Template;
import com.yutel.template.service.ITemplateService;

public class TemplateService implements ITemplateService {

	@Override
	public List<Template> tree(Template temp) {
		return templateDao.tree(temp);
	}
	@Override
	public Page listByPage(Page page) {
		Template temp=(Template)page.getConditions();
		page.setTotalProperty(templateDao.listCount(temp));
		page.setRoot(templateDao.list(temp));
		return page;
	}
	@Override
	public void add(Template temp) {
		templateDao.add(temp);
	}

	@Override
	public void edit(Template temp) {
		templateDao.edit(temp);
	}

	@Override
	public List<Map<String, Object>> listByPID(Template temp) {
		Map<String, String> map =new HashMap<String, String>();
		return templateDao.listByPID(temp, map);
	}

	@Override
	public void remove(Template temp) {
		templateDao.remove(temp);
	}

	

	@Override
	public Map view(Template temp) {
		return templateDao.view(temp);
	}
	private ITemplateDao templateDao;
	public ITemplateDao getTemplateDao() {
		return templateDao;
	}

	public void setTemplateDao(ITemplateDao templateDao) {
		this.templateDao = templateDao;
	}

}
